/*
============================================================================
 Name        : dd_control.c
 Author      : Jian(raphyer@hotmail.com)
 Version     :
 Copyright   : GPL
 Description : dd_control.c - source file
============================================================================
*/

/* INCLUDE FILES */
#include "dd_control.h"


void control_defult_fun_init(dd_control* ctl) 
{
    ctl->draw            = control_def_draw ;
    ctl->update          = control_def_update ;
    ctl->set_focus       = control_def_set_focus ;
    ctl->set_visible     = control_def_set_visible ;
    ctl->child_count     = control_def_child_count ;
    ctl->child           = control_def_child ;
    ctl->is_accept_focus = control_def_is_accept_focus ;
    ctl->set_rect        = control_def_set_rect ;
    ctl->key_handle      = control_def_key_handle ;
}

void control_def_destroy(void* ctl) 
{
    __DD_ASSERT_DEFENSE(ctl, return) ;
    DD_FREE(ctl) ;
}

void control_def_draw(dd_control* ctl, pd_gc* gc) 
{
    __DD_ASSERT_DEFENSE(ctl, return) ;
}

void control_def_update(dd_control* ctl) 
{
    __DD_ASSERT(ctl) ;
}

void control_def_set_focus(dd_control* ctl, DD_BOOL is_focus, DD_BOOL from_forward) 
{
    __DD_ASSERT_DEFENSE(ctl, return) ;

    ctl->is_focus = is_focus;        
}

void control_def_set_visible(dd_control* ctl, DD_BOOL is_visible) 
{
    __DD_ASSERT_DEFENSE(ctl, return) ;

    ctl->is_visible = is_visible ;
}

DD_INT control_def_child_count(dd_control* ctl) 
{
    __DD_ASSERT_DEFENSE(ctl, return 0) ;

    return 0 ;
}

dd_control* control_def_child(dd_control* ctl, DD_INT index) 
{
    __DD_ASSERT(ctl) ;
    return NULL ;
}

DD_BOOL control_def_is_accept_focus(dd_control* ctl) 
{
    __DD_ASSERT_DEFENSE(ctl, return DD_FALSE) ;

    return DD_FALSE ;
}

void control_def_set_rect(dd_control* ctl, dd_rect rect) 
{
    __DD_ASSERT_DEFENSE(ctl, return) ;

    ctl->rect = rect ;
}

DD_BOOL control_def_key_handle(dd_control* ctl, dd_key_code code, dd_key_type type) 
{
    __DD_ASSERT_DEFENSE(ctl, return DD_FALSE) ;

    return DD_FALSE ;
}


/* End of File */
